<template>
	<div class="shopper_wrap">
		<div class="success-list">
				<ul class="success-ul">
					<li class="success-li" v-for="item in shopper" >					
						<div v-if="nickName">
							<a :href="'#/shopmsg/'+item._id">
								<img class="success-img" :src="'/taobao/'+ item.shopImg" alt="" /> 
							</a>
							
						</div>
						<div v-else>
							<a href="#/login">
								<img class="success-img" :src="'/taobao/'+ item.shopImg" alt="" /> 
							</a>
						</div>
						<div class="success-msg">
							<div v-if="nickName">
								<a class="title" :href="'#/shopmsg/'+item._id">{{item.title}}</a>
							</div>
							<div v-else>
								<a class="title" href="#/login">{{item.title}}</a>
							</div>
							<p style="color: #999;font-size: 14px;">月销量: {{item.monNum}} 件</p>
							<p style="color: red; font-size: 14px;">¥ {{item.price}} <span></span></p>
						</div>						
					</li>
				</ul>
			</div>
	</div>
</template>

<script>
	import $ from 'jquery'
	import axios from 'axios'
	import { mapState } from 'vuex'
	export default {
		data() {
			return {
				shopper:[],
							
			}
		},
		computed: {
			...mapState(['nickName'])
		},	
		methods:{
			checkLogin() {
			var that = this;
			axios.get("/taobao/checkLogin").then(function(res) {		
				var res = res.data;
//				console.log(res);
				if(res.error == "0") {	
					that.$store.commit("updateUserInfo", res.result);
				} 	
			})
			},
			getSellShop(){
				var that=  this;
				var author = this.$route.params.author;

				axios.post('/taobao/sellshop/'+author).then(function(result){
				var res = result.data.result;
				that.shopper = res.data;
				})
			}
		},
		mounted(){
			this.getSellShop()
		}
		
	}
</script>

<style scoped="">
	.success-ul {
		float: right;
		overflow: hidden;
		margin-bottom: 200px;
	}
	
	.success-ul .success-li {
		float: left;
		border: solid 1px #ccc;
		padding: 3px;
		margin: 10px;
	}
	
	.success-img {
		width: 150px;
		height: 150px;
		border: solid 1px #eee;
	}
	a{
		color: #333;
	}
</style>